<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/common/taglibs.jsp"%>
<!DOCTYPE html>
<html class="ng-app:myApp" id="ng-app" ng-app="myApp" xmlns:ng="http://angularjs.org">
<head>
<title>回单管理</title>
<%@ include file="/WEB-INF/common/meta.jsp"%>
<%@ include file="/WEB-INF/layouts/global_res_header.jsp"%>
</head>

<body ng-controller="receiptCtrl">
	<div id="mainDataBlock" ng-grid="gridOptions"></div>
	<div id="funcBlock" class="alert alert-info">
		<div class="btn-group btn-group-sm">
			<button type="button" class="btn btn-default" ng-click="onOpenQueryFormModal()">
				<span class="glyphicon glyphicon-search"></span> 查询
			</button>
			<button type="button" class="btn btn-default" ng-click="refresh()">
				<span class="glyphicon glyphicon-refresh"></span> 刷新
			</button>
			<button type="button" class="btn btn-default" ng-click="onOpenExportFormModal()">
				<span class="glyphicon glyphicon-export"></span> 导出
			</button>
		</div>
	</div>
</body>

<div id="queryFormModal" class="modal" tabindex="-1" data-width="450px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">查询</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="queryFormForm" class="form-inline" role="form">	
					<div class="form-group" style="margin-left: 24px">
						<label for="name">客户</label> 
						<select name="clientId" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.clientId" style="width: 100%;" class="select2" data-placeholder="承运商">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="client in clientList" value="{{client.id}}">{{client.shortName}}</option>
						</select>				
					</div>								
					<div class="form-group">
						<label for="st">订单编号</label>
						<input style="width:150px;"  name="orderCd" ng-model="queryForm.orderCd" class="form-control" placeholder="名称">		
					</div>							
					<div class="form-group">
						<label for="shipmentCd">调度单号</label>
						<input style="width:150px;margin-top: 5px"  name="shipmentCd" ng-model="queryForm.shipmentCd" class="form-control" placeholder="名称">		
					</div>
					<div class="form-group">
						<label for="name">回单状态</label> 
						<select name="status" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.status" style="width: 100%;" class="select2" data-placeholder="承运商">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="st in statusList" value="{{st.descr}}">{{st.val}}</option>
						</select>					
					</div>	
					<div class="form-group" style="margin-top: 5px">
						<label for="cd1">批量单号</label>
						<textarea style="width: 355px;"  name="cd1" ng-model="queryForm.cd1" class="form-control"></textarea>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="onQuery()" ng-disabled="queryFormForm.$invalid" class="btn btn-default">查询</button>
	</div>
</div>

<div id="nntModal" class="modal" tabindex="-1" data-width="450"style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">延时回单确认</h4>
	</div>
		<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editNntForm" class="form-inline" role="form" novalidate>
					<div>
						<label for="reason">延时原因：</label>
						<textarea style="width: 300px;height: 50px"  name="reason" ng-model="editFormNnt.reason" class="form-control"></textarea>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="nntConfirm()" ng-disabled="editNntForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div id="changStModal" class="modal" tabindex="-1" data-width="400px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">返还中外运确认</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editCtForm" class="form-horizontal" role="form" novalidate>
					<div class="form-group">
						<label for="backDt" class="col-sm-4 control-label"><span style="font-size: 18px;color:red">*</span>返单时间</label> 
						<div class="col-sm-5"> 
							<input  name="backDt" style="margin-top: 5px" ng-model="editFormCt.backDt" required class="form-control" placeholder="客户">		
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button ng-click="changeSt()" ng-disabled="editCtForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div id="changMsModal" class="modal" tabindex="-1" data-width="400px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">修改应回单时间</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editForm" class="form-horizontal" role="form" novalidate>
					<div class="form-group">
						<label for="mustDt" class="col-sm-4 control-label"><span style="font-size: 18px;color:red">*</span>返单时间</label> 
						<div class="col-sm-5"> 
							<input  name="mustDt" style="margin-top: 5px" ng-model="editForm.mustDt" required class="form-control" placeholder="客户">		
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button ng-click="changeMustDt()" ng-disabled="editForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div id="rcpModal" class="modal" tabindex="-1" data-width="400px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">签收回单</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editRcpForm" class="form-horizontal" role="form" novalidate>
					<div class="form-group hidden">
						<label for="id" class="col-sm-4 control-label">ID</label> 
						<div class="col-sm-5">
							<input type="hidden" name="id" ng-model="editFormRcp.id" class="form-control">		
						</div>
					</div>
					<div class="form-group">
						<label for="platformId" class="col-sm-4 control-label"><span style="font-size: 18px;color:red">*</span>回单时间</label> 
						<div class="col-sm-5">
							<input  name="receiptDt" style="margin-top: 5px" ng-model="editFormRcp.receiptDt" required class="form-control" placeholder="所属平台">		
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="receipt()" ng-disabled="editRcpForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>


<div class="contextMenu" id="menu">
	<ul>
		<li id="find" ng-click="onOpenQueryFormModal()">
		 <img src=""/> 
		&nbsp;查询&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		<li id="refresh" ng-click="refresh()">
		 <img src=""/> 
		&nbsp;刷新&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		<shiro:hasPermission name="oms:receipt:rcp">
		<li id="rcp" ng-click="onOpenRCPModal()">
		 <img src=""/> 
		&nbsp;整单签收&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:receipt:return">
		<li id="return" ng-click="changeStModal()">
		 <img src=""/> 
		&nbsp;返还客户确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:receipt:sign">
		<li id="sign" ng-click="sign()">
		 <img src=""/> 
		&nbsp;标记不合格回单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:receipt:nnt">
		<li id="nnt" ng-click="onOpenNntConfirmModal()">
		 <img src=""/> 
		&nbsp;回单延时确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:receipt:must">
		<li id="must" ng-click="changMsModal()">
		 <img src=""/> 
		&nbsp;修改应回单时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:receipt:cancel">
		<li id="cancel" ng-click="cancelRcp()">
		 <img src=""/> 
		&nbsp;撤销回单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
	</ul>
</div>

<%@ include file="/WEB-INF/layouts/global_res_footer.jsp"%>
<script type="text/javascript" src="${ctx}/res_oms/oms/receipt.js"></script>
<script type="text/javascript" src="${ctx}/res_oms/jquery.contextmenu.r2.js"></script>
</html>
